package com.example.providera;

import com.example.providera.service.SayHelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("/")
@EnableEurekaServer
@SpringBootApplication
public class ProviderAApplication {


    @Autowired
    SayHelloService sayHelloService;

    public static void main(String[] args) {
        SpringApplication.run(ProviderAApplication.class, args);
    }

    @GetMapping("hello")
    public String hello() {
        return sayHelloService.hello();
    }

    @GetMapping("say")
    public String sayHello() {
        return sayHelloService.hello();
    }
}
